/*******************************************************************************
 * Copyright (c) 2009 Kevin Bierhoff and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Kevin Bierhoff - initial API and implementation
 *******************************************************************************/
package com.googlecode.twelfdevtools.preferences;

import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;

import com.googlecode.twelfdevtools.TwelfActivator;
import com.googlecode.twelfdevtools.server.TwelfServer;


/**
 * Class used to initialize default preference values.
 */
public class PreferenceInitializer extends AbstractPreferenceInitializer {

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
	 */
	public void initializeDefaultPreferences() {
		IPreferenceStore store = TwelfActivator.getDefault().getPreferenceStore();
//		store.setDefault(PreferenceConstants.P_CHOICE, "choice2");
		
		// default command to start Twelf server
		// TODO detect platform and set windows / mac / linux default path
		store.setDefault(PreferenceConstants.P_SERVER_CMD,
				TwelfServer.WINDOWS_DEFAULT_PATH);
		
		// match brackets by default
		store.setDefault(PreferenceConstants.P_MATCH_BRACKETS, true);
		// use gray for matching bracket drawing
		RGB gray = Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY).getRGB();
		PreferenceConverter.setDefault(store, 
				PreferenceConstants.P_MATCHING_BRACKETS_COLOR, 
				gray);
		
		store.setDefault(PreferenceConstants.P_HIGHLIGHT_OCCURRENCES, true);
	}
}
